package com.zzty.zzlp.serviceimpl;

import java.util.List;


import com.zzty.zzlp.dao.QuestionMapper;
import com.zzty.zzlp.entity.Question;
import com.zzty.zzlp.service.QuestionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class QuestionServiceImpl implements QuestionService {
    @Autowired
    private QuestionMapper questionMapper;

    @Override
    public List<Question> selectAll(Integer Num1,Integer Num2) {
        return this.questionMapper.selectAll( Num1,  Num2);
    }

    @Override
    public Integer count() {
        return this.questionMapper.count();
    }

    @Override
    public int insertQue(String content) {
        return this.questionMapper.insertQue(content);
    }

    @Override
    public Integer selectQueId(String content) {
        return this.questionMapper.selectQueId(content);
    }

    @Override
    public Question selectQuecontent(String id) {
        return this.questionMapper.selectQuecontent(id);
    }

    @Override
    public  String  Questionbyid(String[] array) {
        String questions = "";
        for (int i = 0; i < array.length; i++) {
            questions = questions + (i + 1) + "." + this.questionMapper.selectQuecontent(array[i]).getContent() + "\r\n";
        }
        return questions;
    }

    @Override
    public Integer searchNewId(String date, String questions, Integer clazzId) {
        return this.questionMapper.searchNewId(date, questions, clazzId);
    }


    @Override
    public Integer searchNewId1(String date, String questions, Integer clazzId) {
        return this.questionMapper.searchNewId1(date, questions, clazzId);
    }

    @Override
    public List<Integer> selectStuId(Integer clazzId,Integer type) {
        return this.questionMapper.selectStuId(clazzId,type);
    }

    @Override
    public Integer insertselfexamtransation(Integer examId, Integer userId) {
        return this.questionMapper.insertselfexamtransation(examId, userId);
    }

    @Override
    public List<String> selectstu_ids(Integer id,Integer class_id) {
        return this.questionMapper.selectstu_ids(id, class_id);
    }

    @Override
    public Integer selectLastSelfId(Integer clazzId) {
        return this.questionMapper.selectLastSelfId( clazzId);
    }

    @Override
    public Integer selectLastTeamId(Integer clazzId) {
        return this.questionMapper.selectLastTeamId( clazzId);
    }

    @Override
    public Integer LastSelfId(Integer clazzId) {
        return this.questionMapper.LastSelfId( clazzId);
    }


}
